<style type="text/css">
    a{color: white;}
    td{border-style: none;}
    form{margin: 0px;}
    table{ /*#777777;*/}
</style>

<strong style="font-size:14px; padding:0; margin:0;">
    Pagos
    <!--
    <a style="margin-left:20px;" title="Imprimir todos los pagos" href="#" onclick="imprimir('<?php echo $this->baseUrl(); ?>/usuarios/credito/imprimirpagolpt1/cuotas_id/<?php echo $this->id_cuota; ?>/credito_id/<?php echo $this->id_credito; ?>/pagos_ids/<?php echo $this->pagos_ids; ?>')" class="btn btn-inverse btn-mini">
        <i class="icon-align-justify icon-white"></i>&nbsp;<i class="icon-print icon-white"></i>
    </a>
    -->
    <a class="btn btn-mini btn-danger pull-right" onclick="$('#id_cuota_<?php echo $this->id_cuota ?>').poshytip('hide');">x</a>
</strong>

<table style="background-color: rgb(255,255,255,0) !important;" >
<tbody>
<?php foreach ($this->pagos as $pago) { ?>
    <tr>
        <td style="width:90px;text-align:center;"><?php echo $pago->getFecha()->format("d/m/Y") ?></td>
        <td style="width:70px;text-align:right;padding-right:10px;"><?php echo "$".$pago->getMonto() ?></td>
        <td>
            <a title="Imprimir pago" href="#" onclick="imprimir('<?php echo $this->baseUrl(); ?>/usuarios/credito/imprimirpagolpt1/cuotas_id/<?php echo $pago->getCuota()->getId()?>/credito_id/<?php echo $pago->getCuota()->getCredito()->getId()?>/pagos_ids/<?php echo $pago->getId(); ?>')" class="btn btn-inverse btn-mini"><i class="icon-print icon-white"></i></a>
            <a title="Descargar pago" href="<?php echo $this->baseUrl("usuarios/credito/imprimirpagoscuota/credito_id/{$this->id_credito}/cuota_id/{$this->id_cuota}/pago_id/{$pago->getId()}") ?>" class="btn btn-inverse btn-mini"><i class="icon-download icon-white"></i></a>
            <?php if($pago->soyElUltimo()){ ?>
            <form style="display: inline;" name="form-anular-pago<?php echo $pago->getId() ?>" id="form-anular-pago<?php echo $pago->getId() ?>" action="<?php echo $this->baseUrl(); ?>/usuarios/credito/anularpago" method="POST">
                <button title="Anular pago" type="button" onclick="anular_pago('form-anular-pago<?php echo $pago->getId() ?>')" id="anular" name="anular" class="btn btn-danger btn-mini"><i class="icon-trash icon-white"></i></button>
                <input type="hidden" id="pago_id" name="pago_id" value="<?php echo $pago->getId() ?>">
                <input type="hidden" id="credito_id" name="credito_id" value="<?php echo $this->id_credito; ?>">
            </form>
            <?php }?>
        </td>
    </tr>
<?php } ?>
</tbody>
</table>
 
<script type="text/javascript">
    function imprimir(url) {
        mywindow = window.open(url, "impresion", "location=1,status=1,scrollbars=1,  width=300,height=300");
        mywindow.moveTo(100,100);
    }    
</script>